package com.xhsj.user.pms.workflow.mapper;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.xhsj.user.pms.workflow.domain.WorkflowIdentitylink;
import com.xhsj.user.pms.workflow.model.RuningTaskProposalIprModel;
import com.xhsj.user.pms.workflow.model.WorkflowIdentitylinkModel;
import com.xhsj.user.utils.Message;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

@Mapper
public interface WorkflowIdentitylinkMapper extends BaseMapper<WorkflowIdentitylink> {

    /**
     * 根据专利ID,节点ID查询对应节点执行人
     * @param disclosureId
     * @param nodeId
     * @return
     */
    List<WorkflowIdentitylink> selectNodeIdentityByDisclosureIdAndNodeId(@Param("disclosureId")
                                                                                 String disclosureId,
                                                                         @Param("nodeId") String nodeId,
                                                                         @Param("statusId") String statusId);

    /**
     * 通过交底书id和节点id查询指派人列表
     * @author 苏小林
     * @date 2020/2/25 15:07
     * @param: disclosureId
     * @param: nodeId
     * @return: java.util.List<java.lang.String>
     */
    List<Map<String,Object>> findUsersByDisclosureIdAndNodeId(@Param("disclosureId") String disclosureId, @Param("nodeId") String nodeId);

   //    查找除了当前用户其他用户有没有审批过
    List<Map<String,Object>> getNoCommitFlowExceNodeId(@Param("flowExceNodeId") String flowExceNodeId, @Param("disclosureId") String disclosureId,
                                                       @Param("statusId") String statusId, @Param("userId") String userId);
    //根据交底书id删除
    int deleteByDisclosureId(@Param("disclosureId") String disclosureId);
    //  删除当前用户的流程
    int deleteByDisclosureAndUserId(@Param("disclosureId") String disclosureId, @Param("userId") String userId);

    // 删除当前用户的流程根据id
    int deleteByProcessTaskId(@Param("processTaskId") String processTaskId);

    // 通过节点id和交底书id查询列表
    List<WorkflowIdentitylink> findByNodeIdAndDisclosureId(@Param("disclosureId") String disclosureId, @Param("nodeId") String nodeId);

    // 技术负责人选择待审核数据
    List<WorkflowIdentitylinkModel> getList();

    void changeDisclosureStatusId();

    void addDisclosureNodeId();

    void updateCZDIPRIdentity();

    void updateBXQLWJIdentity();

    void updatePSHZSIdentity();

    void deleteIPRBXTJFMRZG();

    void updatePSHZSNodeId();

    void updateHSTGDZNodeId();

    void updateJSFZRDIPRNodeId();

    void updateDIPRBXQLWJNodeId();

    void updateJSFZRXZCSNodeId();

    void alertIdentitylinkId();

    void alertIdentitylinkDateTime();

    void alertIdentitylinkNodeId();

    void alertIdentitylinkDisclosureId();

    void alertIdentitylinkNodeName();

    void alertIdentitylinkDeptId();

    void alertIdentitylinkGroupId();

    void alertIdentitylinkUserId();

    int seleteCount();

    void deleteDYIdentitylink();

    void updateJYIPR();

    void updateCSZSHSDZ();

    void alertOpinionDiscId();

    void addCompleteDisclosureId();

    void addCompleteExecId();

    void addCompleteNodeId();

    void addCompleteUpdateTime();

    void addCompleteCreateTime();

    void addCompleteOwnerAs();

    void addCompleteStatus();

    void addCompleteDealUser();

    void addCompleteLabel();

    void dropCompleteParentId();

    void updateNodeId();

    void updateBANodeId();

    void updateSQTGNodeId();

    void addOpinionExecId();

    List<Map<String,Object>> getFlowHiExecId();

    void updateOpin(@Param("flowHiExecId") String flowHiExecId,@Param("opinionId") String opinionId);

    void dorpDisclosureParentId();

    void dropStatusId();

    void updateJSFZRCCIdentity();

   // 当前所在的节点
   Integer getCurrentNodeNum(@Param("disclosureId") String disclosureId);
  // 获取正在节点为ipr查新评审会初审和评审会终审以及初审确认和终审确认的审核人，编写权力文件和说明书
  List<RuningTaskProposalIprModel> getProposalIprTaskById(@Param("disclosureId")String disclosureId);

 void deleteByDisclosureIdAndUserId(@Param("disclosureId")String disclosureId, @Param("subtract")List<Long> subtract);
}